<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>sylv</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>sylv</b> -  Sylvester equation.  </p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>sylv(A,B,C,flag)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>A,B,C</b>
        </tt>: three real matrices of appropriate dimensions.</li>
      <li>
        <tt>
          <b>flag</b>
        </tt>character string (<tt>
          <b>'c'</b>
        </tt> or <tt>
          <b>'d'</b>
        </tt>)</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>X = sylv(A,B,C,'c')</b>
      </tt> computes <tt>
        <b>X</b>
      </tt>, solution
    of the "continuous time" Sylvester equation</p>
    <pre>

A*X+X*B=C 
   
    </pre>
    <p>
      <tt>
        <b>X=sylv(A,B,C,'d')</b>
      </tt> computes <tt>
        <b>X</b>
      </tt>, solution
    of the "discrete time" Sylvester equation</p>
    <pre>

A*X*B-X=C
   
    </pre>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

A=rand(4,4);C=rand(4,3);B=rand(3,3);
X = sylv(A,B,C,'c');
norm(A*X+X*B-C)
X=sylv(A,B,C,'d') 
norm(A*X*B-X-C)
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="lyap.htm">
        <tt>
          <b>lyap</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
